Skip to content

docs(agents): restructure AGENTS.md with progressive disclosure and skills.sh integration#298

Merged
streamer45 merged 11 commits intomainfrom
devin/1776073612-improve-agent-docs
Apr 13, 2026
Merged

docs(agents): restructure AGENTS.md with progressive disclosure and skills.sh integration#298
streamer45 merged 11 commits intomainfrom
devin/1776073612-improve-agent-docs

Conversation

@staging-devin-ai-integration
Copy link
Copy Markdown
Contributor

@staging-devin-ai-integration staging-devin-ai-integration bot commented Apr 13, 2026

Summary

Improves coding agent performance by restructuring AGENTS.md following HumanLayer best practices and adding skills.sh integration.

Key changes:

  1. Rewrote AGENTS.md from 196 → 91 lines. Now contains only universally-applicable instructions: project purpose (WHAT/WHY), codebase map, tech stack, workflow rules, verification commands table, and a progressive disclosure index pointing to detailed guides.

  2. Created agent_docs/ directory with 7 domain-specific guides that agents read only when relevant to their task:

    • architecture.md — Crate relationships, data flow, key abstractions, UI architecture
    • common-pitfalls.md — Known agent mistakes (WS vs REST state, perf baselines, Bun-only, SPDX, lint suppressions, React.memo barriers)
    • e2e-testing.md — E2E setup + headless-browser pitfalls (moved from AGENTS.md)
    • render-performance.md — Full profiling infrastructure docs (moved from AGENTS.md)
    • adding-plugins.md — Plugin addition checklist (moved from AGENTS.md)
    • ui-development.md — React/Zustand/Jotai patterns, state management rules, key directories
    • skills-setup.md — skills.sh integration with recommended packages
  3. Added CLAUDE.md — imports AGENTS.md via @AGENTS.md syntax per Anthropic docs.

  4. Added .claude/skills/ — 7 skills following the Agent Skills open standard. Each skill has a thin SKILL.md (frontmatter + description only) with a guide.md symlink to the corresponding agent_docs/ file. Zero content duplication — agent_docs/ is the single source of truth.

  5. Added skills.sh integration — documents recommended npx skills add commands for React (vercel-labs/agent-skills) and Playwright (anthropics/skills), with clear distinction between repo-maintained skills in .claude/skills/ and user-local installs (~/.claude/skills/).

Fixes applied during review:

  • Jotai/Zustand state management docs corrected (Jotai atoms primary, Zustand transitional)
  • just knipjust knip-ui
  • E2E prerequisites (install-e2e, install-playwright) added
  • Crate dependency diagram direction fixed
  • Stale marketplace/PORTABILITY_REVIEW.md reference replaced with verify_bundles.py
  • React Query scope corrected (dropped "marketplace")
  • State layer count "three" → "four"
  • apps/skit-cli/ added to codebase maps
  • SPDX headers added to all SKILL.md files
  • Rust lint command replaced with just lint-skit (matches actual per-crate feature flags)
  • Skills install location clarified: repo-maintained .claude/skills/ vs user-local installs

Review & Testing Checklist for Human

  • Verify agent_docs/architecture.md accuracy — crate relationships, data flow, UI state management (Jotai primary, Zustand transitional)
  • Verify .claude/skills/ symlinks resolve correctly (guide.md../../agent_docs/<name>.md)
  • Test that Claude Code discovers the skills and loads them on-demand
  • Check agent_docs/common-pitfalls.md for completeness — any other common agent mistakes worth documenting?

Test plan: Have an agent attempt a task (e.g., a UI change or a new node) using the updated docs and compare quality/speed vs previous sessions.

Notes

  • No code changes — documentation only.
  • Existing Devin-specific skills in .agents/skills/ are preserved.
  • Symlink approach for .claude/skills/ avoids content duplication while giving Claude Code native skill discovery.
  • SPDX headers use HTML comments before YAML frontmatter (consistent with all other .md files; Claude Code's parser handles this fine).

Link to Devin session: https://staging.itsdev.in/sessions/a35965cc944145dcad3d95a4bb194dd3
Requested by: @streamer45


Staging: Open in Devin

…kills.sh integration

- Rewrite AGENTS.md to be concise (~90 lines, down from 196) following
  HumanLayer best practices: WHAT/WHY/HOW structure, universally-applicable
  instructions only, progressive disclosure index
- Add codebase map, tech stack summary, and verification commands table
- Create agent_docs/ directory with domain-specific guides:
  - architecture.md: crate relationships, data flow, key abstractions
  - common-pitfalls.md: known agent mistakes (WS state, perf baselines, etc.)
  - e2e-testing.md: E2E setup and headless-browser pitfalls (moved from AGENTS.md)
  - render-performance.md: profiling infrastructure docs (moved from AGENTS.md)
  - adding-plugins.md: plugin addition checklist (moved from AGENTS.md)
  - ui-development.md: React/Zustand/Jotai patterns, state management rules
  - skills-setup.md: skills.sh integration with recommended packages

Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
@staging-devin-ai-integration
Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

Copy link
Copy Markdown
Contributor Author

@staging-devin-ai-integration staging-devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Staging: Open in Devin
Debug

Playground

…, crate deps, and stale path

- Fix Zustand/Jotai state management descriptions in architecture.md,
  common-pitfalls.md, and ui-development.md to reflect the actual code:
  Jotai atoms are the primary store for high-frequency per-node data,
  Zustand handles pipeline structure with transitional compat writes
- Fix just knip -> just knip-ui in AGENTS.md verification table
- Add install-e2e and install-playwright prerequisites to e2e-testing.md
- Fix crate dependency diagram direction in architecture.md (arrows now
  point from dependent to dependency)
- Replace stale marketplace/PORTABILITY_REVIEW.md reference with
  verify_bundles.py in adding-plugins.md
- Fix React Query scope: drop 'marketplace' (uses useState/useEffect)

Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
staging-devin-ai-integration[bot]

This comment was marked as resolved.

…opment.md

Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
Copy link
Copy Markdown
Contributor Author

@staging-devin-ai-integration staging-devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 0 new potential issues.

View 5 additional findings in Devin Review.

Staging: Open in Devin
Debug

Playground

…mpatibility

Per Anthropic docs (https://code.claude.com/docs/en/memory#agents-md),
Claude Code reads CLAUDE.md not AGENTS.md. This file imports AGENTS.md
so both Claude Code and other agents read the same instructions without
duplication.

Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
staging-devin-ai-integration[bot]

This comment was marked as resolved.

…it-cli to maps

- Create .claude/skills/ with thin SKILL.md wrappers (frontmatter only)
  that symlink guide.md -> agent_docs/<name>.md. This gives Claude Code
  progressive disclosure (name+description at startup, full content
  on-demand) with zero content duplication.
- Add apps/skit-cli/ (streamkit-client) to codebase maps in AGENTS.md
  and agent_docs/architecture.md.

Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
Copy link
Copy Markdown
Contributor Author

@staging-devin-ai-integration staging-devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 8 new potential issues.

View 6 additional findings in Devin Review.

Staging: Open in Devin
Debug

Playground

Comment on lines +1 to +6
---
name: adding-plugins
description: Checklist for making a StreamKit plugin official and downloadable from the registry. Use when adding a new native plugin or updating an existing one for marketplace distribution.
---

For the full plugin addition checklist, see [guide.md](guide.md).
Copy link
Copy Markdown
Contributor Author

@staging-devin-ai-integration staging-devin-ai-integration bot Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 YAML frontmatter compatibility with SPDX headers

The .claude/skills/*/SKILL.md files use YAML frontmatter (--- delimiters) as their first content. When adding the SPDX HTML comment header before the frontmatter, some strict markdown/YAML parsers may not recognize the frontmatter if it's not at byte 0 of the file. However, Claude Code's SKILL.md parser (and most modern tools like GitHub, Hugo, Jekyll) handle HTML comments before frontmatter without issue. If a compatibility issue arises with skills.sh tooling, the SPDX header could alternatively be placed inside the frontmatter block as a YAML comment, though the HTML comment approach is consistent with every other .md file in this repo.

Staging: Open in Devin

Was this helpful? React with 👍 or 👎 to provide feedback.

Debug

Playground

…d files

Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
Copy link
Copy Markdown
Contributor Author

@staging-devin-ai-integration staging-devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 0 new potential issues.

View 6 additional findings in Devin Review.

Staging: Open in Devin
Debug

Playground

- skills-setup.md: distinguish repo-maintained .claude/skills/ (committed,
  symlinked to agent_docs/) from user-local skill installs. Warn against
  running npx skills add into the tracked tree.
- AGENTS.md: replace inaccurate cargo clippy --workspace command with
  just lint-skit, which matches the actual lint contract (per-crate
  feature flags, --all-targets, license check).

Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
AGENTS.md Outdated
| `sdks/plugin-sdk/` | Plugin SDKs for Rust, Go, and C |
| `ui/` | React 19 web UI (Vite + Bun) |
| `plugins/native/` | Official ML plugins (Whisper, Kokoro, NLLB, etc.) |
| `samples/pipelines/` | Example YAML pipelines (`dynamic/` and `oneshot/`) |
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's more under samples/ worth documenting as it serves all of our assets (e.g. audio files, images, fonts, slint files, and likely more in the future).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point — updated to samples/ (not samples/pipelines/) and expanded the description to include audio files, images, fonts, and Slint files. Fixed in 9a2db12.

| `ui/` | React 19 web UI (Vite + Bun) |
| `plugins/native/` | Official ML plugins (Whisper, Kokoro, NLLB, etc.) |
| `samples/pipelines/` | Example YAML pipelines (`dynamic/` and `oneshot/`) |
| `e2e/` | Playwright end-to-end tests |
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

worth mentioning we have another level of non-UI e2e tests, under tests/, which are essentially oneshot pipeline validations atm.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked for a top-level tests/ directory but it doesn't exist yet on main (only e2e/tests/). Could you clarify where these oneshot pipeline validation tests live? Happy to add the entry once I know the path — or if this is something planned, I can add it when it lands.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR is not up to date with main, you should merge.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merged main into the branch. However, tests/ still doesn't exist at the repo root after the merge — only e2e/tests/. Is it on a different branch, or something planned? Happy to add the codebase map entry once it lands.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies, these are getting introduced in #279, but still makes sense to assume they are in so we don't forget later as we'll merge both soon.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for clarifying — added tests/ to both codebase maps (AGENTS.md and architecture.md) as "Pipeline validation tests (oneshot pipeline smoke tests)". Fixed in 58087fd.

AGENTS.md Outdated

## Tech Stack

- **Rust 1.92** (pinned in `rust-toolchain.toml`), tokio, axum, wgpu
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we keep this maintainable? For example, we might upgrade to v1.94 tomorrow.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair concern — removed the hardcoded version. Now reads **Rust** (version pinned in \rust-toolchain.toml`)` so it stays accurate across upgrades. Fixed in 9a2db12.

AGENTS.md Outdated

- Official images: `Dockerfile` (CPU) and `Dockerfile.gpu` (GPU) via `.github/workflows/docker.yml`.
- Health endpoint: `/healthz` (also `/health`).
- Images do not bundle ML models or plugins — mount them at runtime.
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: we do have full versions that do.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to distinguish slim vs full images: "Slim images do not bundle ML models or plugins — mount them at runtime. Full images (with -full tag) include bundled models and plugins." Fixed in 9a2db12.

Comment on lines +30 to +31
- **Human review required** before bundling any new third-party shared libraries
(licensing, security, size, and distro compatibility).
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, if a plugin relies on models, we want to upload them to our streamkit Huggingface repo so they're accessible indefinitely, license permitting. But if the license is that restrictive, we probably shouldn't build a plugin with it anyway.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good addition — added a bullet point: "Models: if the plugin relies on ML models, upload them to the StreamKit Hugging Face repo so they remain accessible indefinitely (license permitting)." Fixed in 9a2db12.

streamkit-devin and others added 2 commits April 13, 2026 14:06
…r, and models

- samples/ row: mention assets (audio, images, fonts, Slint files) not just pipelines
- Rust version: reference rust-toolchain.toml instead of hardcoding 1.92
- Docker: note that slim images don't bundle models but full images do
- adding-plugins.md: add step to upload models to HuggingFace repo

Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
Copy link
Copy Markdown
Contributor Author

@staging-devin-ai-integration staging-devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 new potential issues.

View 7 additional findings in Devin Review.

Staging: Open in Devin
Debug

Playground

- **Human review required** before bundling any new third-party shared libraries
(licensing, security, size, and distro compatibility).
| All lints | `just lint` |
| Rust lint only | `just lint-skit` (fmt + clippy with per-crate feature flags + license check) |
Copy link
Copy Markdown
Contributor Author

@staging-devin-ai-integration staging-devin-ai-integration bot Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 AGENTS.md incorrectly claims just lint-skit includes a license check

The Verification Commands table states just lint-skit performs "fmt + clippy with per-crate feature flags + license check", but the actual lint-skit recipe in the justfile only runs cargo fmt and cargo clippy. The license check is performed by the separate check-license-headers recipe, which is invoked by just lint but not by just lint-skit. An agent that runs only just lint-skit (believing it covers license compliance) would miss the SPDX/REUSE check entirely.

Staging: Open in Devin

Was this helpful? React with 👍 or 👎 to provide feedback.

Debug

Playground

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This finding is incorrect — lint-skit does include a license check. Line 235 of the justfile runs cargo deny check licenses as part of the lint-skit recipe. The description "fmt + clippy with per-crate feature flags + license check" is accurate.

Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
Copy link
Copy Markdown
Contributor Author

@staging-devin-ai-integration staging-devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View 7 additional findings in Devin Review.

Staging: Open in Devin
Debug

Playground

Comment on lines +77 to +78
- Standard images do not bundle ML models or plugins — mount them at runtime.
Demo images (`Dockerfile.demo`, tagged `-demo`) include bundled models and plugins.
Copy link
Copy Markdown
Contributor Author

@staging-devin-ai-integration staging-devin-ai-integration bot Apr 13, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 Legacy Dockerfile.full and Dockerfile.full-gpu still exist alongside new Dockerfile.demo

The Docker section now references only Dockerfile.demo (tagged -demo), which matches the current .github/workflows/docker.yml. However, the repo still contains Dockerfile.full and Dockerfile.full-gpu files. These appear to be legacy files not referenced by any workflow. While the new documentation is accurate about the active Docker setup, the presence of these stale Dockerfiles could confuse contributors who browse the repo root. Consider removing them or adding a note.

Staging: Open in Devin

Was this helpful? React with 👍 or 👎 to provide feedback.

Debug

Playground

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acknowledged — the documentation now accurately describes the active Docker workflow (Dockerfile, Dockerfile.gpu, Dockerfile.demo). The stale Dockerfile.full / Dockerfile.full-gpu files are a pre-existing cleanup item outside the scope of this docs PR. @streamer45 — want me to file a separate issue to track removing those?

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

streamkit:full-gpu is actually used as base for our private demo deployment so I'd leave as is.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it — Dockerfile.full-gpu is in active use for the private demo deployment. No cleanup needed then. The docs are accurate as-is for the public workflow.

Signed-off-by: StreamKit Devin <devin@streamkit.dev>
Co-Authored-By: Claudio Costa <cstcld91@gmail.com>
Copy link
Copy Markdown
Contributor Author

@staging-devin-ai-integration staging-devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 new potential issue.

View 7 additional findings in Devin Review.

Staging: Open in Devin
Debug

Playground

| `ui/` | React 19 web UI (Vite + Bun) |
| `plugins/native/` | Official ML plugins (Whisper, Kokoro, NLLB, etc.) |
| `samples/` | Example pipelines (`dynamic/` and `oneshot/`), audio files, images, fonts, Slint files |
| `tests/` | Pipeline validation tests (oneshot pipeline smoke tests) |
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚩 Codebase map references tests/ directory that doesn't exist yet

Both AGENTS.md:36 and agent_docs/architecture.md:37 document a tests/ directory for "Pipeline validation tests (oneshot pipeline smoke tests)". This directory does not exist on origin/main or in the current working tree. It was introduced in commit 70347b9 (PR #285: "feat(e2e): add headless pipeline validation tests") which is not yet merged into main. If this PR merges before #285, the documentation will reference a non-existent directory. Not flagged as a bug because it's common for doc PRs to anticipate parallel changes, and the impact is limited to documentation accuracy.

Staging: Open in Devin

Was this helpful? React with 👍 or 👎 to provide feedback.

Debug

Playground

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Intentional — the maintainer explicitly requested adding tests/ to anticipate the parallel PR landing soon.

@streamer45 streamer45 merged commit 85f27b1 into main Apr 13, 2026
8 checks passed
@streamer45 streamer45 deleted the devin/1776073612-improve-agent-docs branch April 13, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants